package com.the_last.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.the_last.pojo.dto.SysPermissionDTO;
import com.the_last.pojo.po.SysPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysPermissionMapper extends BaseMapper<SysPermission> {
    
    List<SysPermission> selectPermissionsByUserId(@Param("userId") Long userId);
    
    List<SysPermission> selectPermissionsByRoleId(@Param("roleId") Long roleId);
    
    /**
     * 分页查询权限信息（关联业务类型）
     * @param page 分页参数
     * @param queryDTO 查询条件
     * @return 权限分页数据
     */
    Page<SysPermission> selectPermissionPageWithBusinessType(Page<SysPermission> page, @Param("query") SysPermissionDTO queryDTO);
    
}